from django.db import models
from users.models import User
from meiduo_mall.utils.my_model import BaseModel


# class BaseModel(models.Model):
#     create_time = models.DateTimeField(auto_now_add=True, verbose_name="创建时间")
#     update_time = models.DateTimeField(auto_now=True, verbose_name="更新时间")
#
#     class Meta:
#         # 作用：只能被继承用，不能被迁移
#         abstract = True

class QQUser(BaseModel):
    # 关联美多用户

    user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name="美多商城用户")
    openid = models.CharField(max_length=1024, verbose_name="qq用户的id")

    class Meta:
        db_table = "tb_qq_user"


class SinaUser(BaseModel):
    # 关联美多用户

    user = models.ForeignKey(User, on_delete=models.CASCADE, verbose_name="美多商城用户")
    uid = models.CharField(max_length=1024, verbose_name="新浪微博ID")

    class Meta:
        db_table = "tb_sina_user"

# Create your models here.
